package com.linwen.junit;

public class Calculator implements ICalculator {
	private int x;
	private int y;
	private int result;
	
	public int getResult() {
		return result;
	}

	public void setResult(int result) {
		this.result = result;
	}

	public int getX() {
		return x;
	}

	public void setX(int x) {
		this.x = x;
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}

	@Override
	public int add() {
		return result = x+y;
	}

	@Override
	public int substract() {
		return result = x-y;
	}

	@Override
	public int mulitipy() {
		return result = x*y;
	}

	@Override
	public int divide() {
		return result = x/y;
	}
	
	public int square(int x){
		return result = x*x;
	}
}
